/*
 * =====================================================================================
 *
 *       Filename:  sockaddr.cpp
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  2008年09月25日 10时09分58秒
 *       Revision:  none
 *       Compiler:  g++
 *
 *         Author:  ZhixiongHong (hzx), fishwarter@gmail.com
 *        Company:  Unioncast
 *
 * =====================================================================================
 */

#include "sockaddr.h"

#ifdef HAS_SS_NAMESPACE
using namespace ss;
#endif // HAS_SS_NAMESPACE


SockAddr::SockAddr(unsigned int ip, unsigned short port)
{
	memset(&_addr, 0, sizeof(_addr));	
	_addr.sin_family = AF_INET;
	_addr.sin_addr.s_addr = htonl(ip);
	_addr.sin_port = htons(port);
}

SockAddr::SockAddr(const char* ipstr, unsigned short)
{
	memset(&_addr, 0, sizeof(_addr));	
	_addr.sin_family = AF_INET;	
	_addr.sin_addr.s_addr = inet_addr(ipstr);	
	_addr.sin_port = htons(port);
}


SockAdd::SockAddr(const SockAdd& addr)
{
	memcpy((void *)&_addr, (void *)&(addr._addr), sizeof(struct sockaddr_in));		
}

	
SockAddr::SockAddr& operator=(const SockAddr& addr)
{
	if( this == &addr )	
		return 	
}

bool SockAddr::operator==(const MSockAddr cmper)
{

}

bool SockAddr::operator!=(const MSockAddr cmper)
{

}

bool SockAddr::is_private_ip(const char* ipstr)
{

}

bool SockAddr::is_private_ip(unsigned int ip)
{

}

bool SockAddr::is_ip_str(const char* content)
{

}

bool SockAddr::gethostname(char* str)
{

}

unsigned int SockAddr::getlocalip()
{

}

bool SockAddr::getgatwayaddress()
{

}
